<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        // break 打破，打破循环，跳出整个循环
        for (var i = 0; i < 10; i++) {
            if (i == 3) {
                console.log('==3');
                break; // 跳出真个xh
                // continue,是跳出某次循环
                console.log('break');
            }
            console.log(i);
        }
        for (var i = 0; i < 10; i++) {
            if (i == 5) {
                console.log('我不喜欢吃第五个包子');
                break;
            }
            console.log('我在吃第' + i + '包子');
        }

    </script>
</head>

<body>

</body>

</html>